{extend name="layout/main" /}

{block name="header"}

{/block}

{block name="content"}
<section class="panel">
    <header class="panel-heading">
        <h4>交易记录</h4>
    </header>
    <div class="panel-body" style="padding-bottom: 50px">
        <form class="form-horizontal" action="">
            <div class="form-group">
                <div class="col-xs-1 no-pd-r">
                    <select name="types" id="types" class="form-control">
                        <option value="0">全部类型</option>
                        <option {if $Request.get.types == '1'} selected {/if} value="1">申请中</option>
                        <option {if $Request.get.types == '2'} selected {/if} value="2">通过</option>
                        <option {if $Request.get.types == '2'} selected {/if} value="2">拒绝</option>
                    </select>
                </div>

                <div class="col-xs-3 no-pd-l">
                    <input type="text" id="keyword" value="{$Request.get.keyword}" name="keyword" class="form-control" placeholder="请输入会员账号搜索">
                </div>

                <button type="submit" class="btn btn-color">搜索</button>
                <!--<button type="button" class="btn btn-success" id="export">导出</button>-->
                {if $count}
                &nbsp;&nbsp;总量：{$count}
                {/if}
            </div>
        </form>
        <table class="table table-bordered table-striped no-margin">
            <thead>
            <tr>
                <th class="text-center">id</th>
                <th class="text-center">会员账号</th>
                <th class="text-center">券类型</th>
                <th class="text-center">数量</th>
                <th class="text-center">手续费</th>
                <th class="text-center">提券地址</th>
                <th class="text-center">时间</th>
                <th class="text-center">状态</th>
                <th class="text-center">操作</th>
            </tr>
            </thead>
            <tbody>
            {if !empty($list)}
            {foreach $list as $entity}
            <tr>
                <td class="text-center">{$entity.id}</td>
                <td class="text-center">{$entity.nick_name}</td>
                <td class="text-center">GYG</td>
                <td class="text-center">{$entity.num}</td>
                <td class="text-center">{$entity.ratio}</td>
                <td class="text-center">{$entity.address}</td>
                <td class="text-center">{$entity.create_time}</td>
                <td class="text-center">
                    {if $entity.status == 1}<span class="btn btn-xs btn-default">申请中</span>
                    {elseif $entity.status == 2}<span class="btn btn-xs btn-success">通过</span>
                    {elseif $entity.status == 3}<span class="btn btn-xs btn-danger">拒绝</span>
                    {/if}
                </td>

                <td class="text-center">
                    {if $entity.status == 1}
                    <a data-url="{:url('reg_yes',['id'=>$entity.id])}" onclick="main.ajaxDelete(this)" data-msg="确定要通过申请吗？" class="btn btn-xs btn-info">通过</a>
                    <a data-url="{:url('reg_no',['id'=>$entity.id])}" onclick="main.ajaxDelete(this)" data-msg="确定要拒绝申请吗？" class="btn btn-xs btn-danger">拒绝</a>
                    {/if}
                </td>
            </tr>
            {/foreach}
            {else /}
            <tr class="text-center">
                <td colspan="7">暂无数据</td>
            </tr>
            {/if}
            </tbody>
        </table>
        <div class="page">
            {:htmlspecialchars_decode($list->render())}
        </div>
    </div>
</section>
{/block}


{block name="footer"}

<script>
    function showContent(e){
        $.dialog({
            title: '图片',
            content: $(e).attr('data-content')
        });
    }

</script>
{/block}
